#ifndef CHECK_H
#define CHECK_H
#include <QString>
#include <pcl/registration/icp.h>
#include "component.h"

/*!
 \file check.h This file contains the check class.
 \author Sqizzato Stefano
 \author Maroso Alessandro

*/

/*!
 \enum CheckType This enum classifies all the possible types of check.

*/
enum CheckType { PRESENCE, POSITION, INCLINATION, ORIENTATION, COLOR, HEIGHT, RADIUS };

/*!
 \brief The class representing a single check.
 \author Sqizzato Stefano
 \author Maroso Alessandro

*/
class Check
{
public:
    /*!
     \brief Empty constructor.

    */
    Check();
    /*!
     \brief Constructor.

     \param[in] componentName_ The name of the component on which to perform the check.
     \param[in] type_ The type of the check.
     \param[in] thresholdValue_ The threshold value of the check.
    */
    Check(QString componentName_, CheckType type_, float thresholdValue_);
    /*!
     \brief Destructor.

    */
    virtual ~Check() {}

//GETTERS
    /*!
     \brief Gets the name of the component of this check.

     \return QString The name of the component of this check.
    */
    QString getComponentName();
    /*!
     \brief Gets the type of the check.

     \return CheckType The type of the check
    */
    CheckType getType();
    /*!
     \brief Gets the value of the threshold of this check.

     \return float The value of the threshold of this check.
    */
    float getThresholdValue();
    /*!
     \brief Gets The rigid transformation between the source and the target component.

     \param[in] sourceComponent The source component.
     \param[in] targetComponent The target component.
     \return Eigen::Matrix4f The rigid transformation between the source and the target component.
    */
    Eigen::Matrix4f getTransformation(Component* sourceComponent, Component* targetComponent);
    /*!
     \brief Gets The rigid transformation between the source and the target component.

     \param[in] sourceComponent The source component.
     \param[in] targetComponent The target component.
     \param[out] testCloud The test cloud used for debugging purposes.
     \return Eigen::Matrix4f The rigid transformation between the source and the target component.
    */
    Eigen::Matrix4f getTransformation(Component* sourceComponent, Component* targetComponent, PointCloud<PointXYZRGB>::Ptr testCloud);

protected:
    QString componentName; /*!< component target of the test */
    QString secondComponentName; /*!< component target of the test */
    CheckType type; /*!< type of check  TODO */
    float thresholdValue; /*!< threshold value for the specific test */
    Eigen::Matrix4f transformation; /*!< the transformation that brings the source to the target component */
};

#endif // CHECK_H
